#!/bin/bash
set -ex

echo "Running cycle count measurements..."

SIM='sbsim --march=sb3500 WlanMacPhyRf.sbx --sim --force --pkttx pktsize 1500 --loopback'

echo "Testing Open..."
$SIM --cc

echo "Testing Open(Frag)..."
$SIM --cc --frag 500

echo "Testing Open(Broadcast)..."
$SIM --cc --pktbroad

echo "Testing Open(Frag/Broadcast)..."
$SIM --cc --pktbroad --frag 500

echo "Testing WEP..."
$SIM --cc --wep

echo "Testing WEP(Frag)..."
$SIM --cc --wep --frag 500

echo "Testing WEP(Broadcast)..."
$SIM --cc --wep --pktbroad

echo "Testing WEP(Frag/Broadcast)..."
$SIM --cc --wep --pktbroad --frag 500

echo "done."

echo "Running cycle count measurements with -a option..."

SIM='sbsim -a --march=sb3500 WlanMacPhyRf.sbx --sim --force --pkttx pktsize 1500 --loopback'

echo "Testing Open..."
$SIM --cc

echo "Testing Open(Frag)..."
$SIM --cc --frag 500

echo "Testing Open(Broadcast)..."
$SIM --cc --pktbroad

echo "Testing Open(Frag/Broadcast)..."
$SIM --cc --pktbroad --frag 500

echo "Testing WEP..."
$SIM --cc --wep

echo "Testing WEP(Frag)..."
$SIM --cc --wep --frag 500

echo "Testing WEP(Broadcast)..."
$SIM --cc --wep --pktbroad

echo "Testing WEP(Frag/Broadcast)..."
$SIM --cc --wep --pktbroad --frag 500

echo "done."
